/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package component.stringtoimgcomp;

import java.io.File;
import java.io.IOException;

/**
 *
 * @author Administrator
 */
    public class Test {  
        public static void main(String[] args) {  
            try{  
                StringBuilder sb = new StringBuilder();  
                sb.append("中华人民共和国\n");  
                sb.append("中华人民共和国\n");
                
                FileImageCreator creator = new FileImageCreator(new SimpleDrawer(), "D:/hangdaoimg/钻孔.jpeg");  //这样吧！这个默认有个工作区间吧，把我的文件都放在那里也好管理
                creator.setWidth(150); //图片宽度  
                creator.setHeight(100); //图片高度  
                creator.setLineNum(20); //干扰线条数  
                creator.setFontSize(18); //字体大小  
                creator.setFontName("黑体");  
                  
                //文字旋转  
                creator.setRadian(30.0); //旋转弧度  
                creator.setRotateX(creator.getWidth()/5);  
                creator.setRotateY(creator.getHeight()*5/10);  
                  
                creator.generateImage(sb.toString());  
                  
                System.out.println("ok");  
                  
            }catch(IOException ex){  
            }  
        }  
    }  
